//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS FIS service.
///
/// Amazon Web Services Fault Injection Service is a managed service that enables you to perform fault injection  experiments on your Amazon Web Services workloads. For more information, see the Fault Injection Service User Guide.
public struct FIS: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the FIS client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "FIS",
            serviceIdentifier: "fis",
            serviceProtocol: .restjson,
            apiVersion: "2020-12-01",
            endpoint: endpoint,
            errorType: FISErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates an experiment template.  An experiment template includes the following components:    Targets: A target can be a specific resource in  your Amazon Web Services environment, or one or more resources that match criteria that you specify, for example, resources that have specific tags.    Actions: The actions to carry out on the target. You can specify multiple actions, the duration of each action, and when to start each action during an experiment.    Stop conditions: If a stop condition is triggered while an experiment is running, the experiment is automatically stopped. You can define a stop condition as a CloudWatch alarm.   For more information, see experiment templates in the Fault Injection Service User Guide.
    @Sendable
    @inlinable
    public func createExperimentTemplate(_ input: CreateExperimentTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateExperimentTemplateResponse {
        try await self.client.execute(
            operation: "CreateExperimentTemplate", 
            path: "/experimentTemplates", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an experiment template.  An experiment template includes the following components:    Targets: A target can be a specific resource in  your Amazon Web Services environment, or one or more resources that match criteria that you specify, for example, resources that have specific tags.    Actions: The actions to carry out on the target. You can specify multiple actions, the duration of each action, and when to start each action during an experiment.    Stop conditions: If a stop condition is triggered while an experiment is running, the experiment is automatically stopped. You can define a stop condition as a CloudWatch alarm.   For more information, see experiment templates in the Fault Injection Service User Guide.
    ///
    /// Parameters:
    ///   - actions: The actions for the experiment.
    ///   - clientToken: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - description: A description for the experiment template.
    ///   - experimentOptions: The experiment options for the experiment template.
    ///   - experimentReportConfiguration: The experiment report configuration for the experiment template.
    ///   - logConfiguration: The configuration for experiment logging.
    ///   - roleArn: The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.
    ///   - stopConditions: The stop conditions.
    ///   - tags: The tags to apply to the experiment template.
    ///   - targets: The targets for the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func createExperimentTemplate(
        actions: [String: CreateExperimentTemplateActionInput],
        clientToken: String = CreateExperimentTemplateRequest.idempotencyToken(),
        description: String,
        experimentOptions: CreateExperimentTemplateExperimentOptionsInput? = nil,
        experimentReportConfiguration: CreateExperimentTemplateReportConfigurationInput? = nil,
        logConfiguration: CreateExperimentTemplateLogConfigurationInput? = nil,
        roleArn: String,
        stopConditions: [CreateExperimentTemplateStopConditionInput],
        tags: [String: String]? = nil,
        targets: [String: CreateExperimentTemplateTargetInput]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateExperimentTemplateResponse {
        let input = CreateExperimentTemplateRequest(
            actions: actions, 
            clientToken: clientToken, 
            description: description, 
            experimentOptions: experimentOptions, 
            experimentReportConfiguration: experimentReportConfiguration, 
            logConfiguration: logConfiguration, 
            roleArn: roleArn, 
            stopConditions: stopConditions, 
            tags: tags, 
            targets: targets
        )
        return try await self.createExperimentTemplate(input, logger: logger)
    }

    /// Creates a target account configuration for the experiment template. A target account configuration is required when accountTargeting of experimentOptions is set to multi-account. For more information, see experiment options in the Fault Injection Service User Guide.
    @Sendable
    @inlinable
    public func createTargetAccountConfiguration(_ input: CreateTargetAccountConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateTargetAccountConfigurationResponse {
        try await self.client.execute(
            operation: "CreateTargetAccountConfiguration", 
            path: "/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a target account configuration for the experiment template. A target account configuration is required when accountTargeting of experimentOptions is set to multi-account. For more information, see experiment options in the Fault Injection Service User Guide.
    ///
    /// Parameters:
    ///   - accountId: The Amazon Web Services account ID of the target account.
    ///   - clientToken: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - description: The description of the target account.
    ///   - experimentTemplateId: The experiment template ID.
    ///   - roleArn: The Amazon Resource Name (ARN) of an IAM role for the target account.
    ///   - logger: Logger use during operation
    @inlinable
    public func createTargetAccountConfiguration(
        accountId: String,
        clientToken: String? = CreateTargetAccountConfigurationRequest.idempotencyToken(),
        description: String? = nil,
        experimentTemplateId: String,
        roleArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateTargetAccountConfigurationResponse {
        let input = CreateTargetAccountConfigurationRequest(
            accountId: accountId, 
            clientToken: clientToken, 
            description: description, 
            experimentTemplateId: experimentTemplateId, 
            roleArn: roleArn
        )
        return try await self.createTargetAccountConfiguration(input, logger: logger)
    }

    /// Deletes the specified experiment template.
    @Sendable
    @inlinable
    public func deleteExperimentTemplate(_ input: DeleteExperimentTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteExperimentTemplateResponse {
        try await self.client.execute(
            operation: "DeleteExperimentTemplate", 
            path: "/experimentTemplates/{id}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified experiment template.
    ///
    /// Parameters:
    ///   - id: The ID of the experiment template.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteExperimentTemplate(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteExperimentTemplateResponse {
        let input = DeleteExperimentTemplateRequest(
            id: id
        )
        return try await self.deleteExperimentTemplate(input, logger: logger)
    }

    /// Deletes the specified target account configuration of the experiment template.
    @Sendable
    @inlinable
    public func deleteTargetAccountConfiguration(_ input: DeleteTargetAccountConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteTargetAccountConfigurationResponse {
        try await self.client.execute(
            operation: "DeleteTargetAccountConfiguration", 
            path: "/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified target account configuration of the experiment template.
    ///
    /// Parameters:
    ///   - accountId: The Amazon Web Services account ID of the target account.
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteTargetAccountConfiguration(
        accountId: String,
        experimentTemplateId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteTargetAccountConfigurationResponse {
        let input = DeleteTargetAccountConfigurationRequest(
            accountId: accountId, 
            experimentTemplateId: experimentTemplateId
        )
        return try await self.deleteTargetAccountConfiguration(input, logger: logger)
    }

    /// Gets information about the specified FIS action.
    @Sendable
    @inlinable
    public func getAction(_ input: GetActionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetActionResponse {
        try await self.client.execute(
            operation: "GetAction", 
            path: "/actions/{id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified FIS action.
    ///
    /// Parameters:
    ///   - id: The ID of the action.
    ///   - logger: Logger use during operation
    @inlinable
    public func getAction(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetActionResponse {
        let input = GetActionRequest(
            id: id
        )
        return try await self.getAction(input, logger: logger)
    }

    /// Gets information about the specified experiment.
    @Sendable
    @inlinable
    public func getExperiment(_ input: GetExperimentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetExperimentResponse {
        try await self.client.execute(
            operation: "GetExperiment", 
            path: "/experiments/{id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified experiment.
    ///
    /// Parameters:
    ///   - id: The ID of the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func getExperiment(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetExperimentResponse {
        let input = GetExperimentRequest(
            id: id
        )
        return try await self.getExperiment(input, logger: logger)
    }

    /// Gets information about the specified target account configuration of the experiment.
    @Sendable
    @inlinable
    public func getExperimentTargetAccountConfiguration(_ input: GetExperimentTargetAccountConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetExperimentTargetAccountConfigurationResponse {
        try await self.client.execute(
            operation: "GetExperimentTargetAccountConfiguration", 
            path: "/experiments/{experimentId}/targetAccountConfigurations/{accountId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified target account configuration of the experiment.
    ///
    /// Parameters:
    ///   - accountId: The Amazon Web Services account ID of the target account.
    ///   - experimentId: The ID of the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func getExperimentTargetAccountConfiguration(
        accountId: String,
        experimentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetExperimentTargetAccountConfigurationResponse {
        let input = GetExperimentTargetAccountConfigurationRequest(
            accountId: accountId, 
            experimentId: experimentId
        )
        return try await self.getExperimentTargetAccountConfiguration(input, logger: logger)
    }

    /// Gets information about the specified experiment template.
    @Sendable
    @inlinable
    public func getExperimentTemplate(_ input: GetExperimentTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetExperimentTemplateResponse {
        try await self.client.execute(
            operation: "GetExperimentTemplate", 
            path: "/experimentTemplates/{id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified experiment template.
    ///
    /// Parameters:
    ///   - id: The ID of the experiment template.
    ///   - logger: Logger use during operation
    @inlinable
    public func getExperimentTemplate(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetExperimentTemplateResponse {
        let input = GetExperimentTemplateRequest(
            id: id
        )
        return try await self.getExperimentTemplate(input, logger: logger)
    }

    ///  Gets information about the specified safety lever.
    @Sendable
    @inlinable
    public func getSafetyLever(_ input: GetSafetyLeverRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSafetyLeverResponse {
        try await self.client.execute(
            operation: "GetSafetyLever", 
            path: "/safetyLevers/{id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Gets information about the specified safety lever.
    ///
    /// Parameters:
    ///   - id:  The ID of the safety lever.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSafetyLever(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSafetyLeverResponse {
        let input = GetSafetyLeverRequest(
            id: id
        )
        return try await self.getSafetyLever(input, logger: logger)
    }

    /// Gets information about the specified target account configuration of the experiment template.
    @Sendable
    @inlinable
    public func getTargetAccountConfiguration(_ input: GetTargetAccountConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTargetAccountConfigurationResponse {
        try await self.client.execute(
            operation: "GetTargetAccountConfiguration", 
            path: "/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified target account configuration of the experiment template.
    ///
    /// Parameters:
    ///   - accountId: The Amazon Web Services account ID of the target account.
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTargetAccountConfiguration(
        accountId: String,
        experimentTemplateId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTargetAccountConfigurationResponse {
        let input = GetTargetAccountConfigurationRequest(
            accountId: accountId, 
            experimentTemplateId: experimentTemplateId
        )
        return try await self.getTargetAccountConfiguration(input, logger: logger)
    }

    /// Gets information about the specified resource type.
    @Sendable
    @inlinable
    public func getTargetResourceType(_ input: GetTargetResourceTypeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTargetResourceTypeResponse {
        try await self.client.execute(
            operation: "GetTargetResourceType", 
            path: "/targetResourceTypes/{resourceType}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the specified resource type.
    ///
    /// Parameters:
    ///   - resourceType: The resource type.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTargetResourceType(
        resourceType: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTargetResourceTypeResponse {
        let input = GetTargetResourceTypeRequest(
            resourceType: resourceType
        )
        return try await self.getTargetResourceType(input, logger: logger)
    }

    /// Lists the available FIS actions.
    @Sendable
    @inlinable
    public func listActions(_ input: ListActionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListActionsResponse {
        try await self.client.execute(
            operation: "ListActions", 
            path: "/actions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the available FIS actions.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listActions(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListActionsResponse {
        let input = ListActionsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listActions(input, logger: logger)
    }

    /// Lists the resolved targets information of the specified experiment.
    @Sendable
    @inlinable
    public func listExperimentResolvedTargets(_ input: ListExperimentResolvedTargetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListExperimentResolvedTargetsResponse {
        try await self.client.execute(
            operation: "ListExperimentResolvedTargets", 
            path: "/experiments/{experimentId}/resolvedTargets", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the resolved targets information of the specified experiment.
    ///
    /// Parameters:
    ///   - experimentId: The ID of the experiment.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results,  make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - targetName: The name of the target.
    ///   - logger: Logger use during operation
    @inlinable
    public func listExperimentResolvedTargets(
        experimentId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        targetName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListExperimentResolvedTargetsResponse {
        let input = ListExperimentResolvedTargetsRequest(
            experimentId: experimentId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            targetName: targetName
        )
        return try await self.listExperimentResolvedTargets(input, logger: logger)
    }

    /// Lists the target account configurations of the specified experiment.
    @Sendable
    @inlinable
    public func listExperimentTargetAccountConfigurations(_ input: ListExperimentTargetAccountConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListExperimentTargetAccountConfigurationsResponse {
        try await self.client.execute(
            operation: "ListExperimentTargetAccountConfigurations", 
            path: "/experiments/{experimentId}/targetAccountConfigurations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the target account configurations of the specified experiment.
    ///
    /// Parameters:
    ///   - experimentId: The ID of the experiment.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listExperimentTargetAccountConfigurations(
        experimentId: String,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListExperimentTargetAccountConfigurationsResponse {
        let input = ListExperimentTargetAccountConfigurationsRequest(
            experimentId: experimentId, 
            nextToken: nextToken
        )
        return try await self.listExperimentTargetAccountConfigurations(input, logger: logger)
    }

    /// Lists your experiment templates.
    @Sendable
    @inlinable
    public func listExperimentTemplates(_ input: ListExperimentTemplatesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListExperimentTemplatesResponse {
        try await self.client.execute(
            operation: "ListExperimentTemplates", 
            path: "/experimentTemplates", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your experiment templates.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listExperimentTemplates(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListExperimentTemplatesResponse {
        let input = ListExperimentTemplatesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listExperimentTemplates(input, logger: logger)
    }

    /// Lists your experiments.
    @Sendable
    @inlinable
    public func listExperiments(_ input: ListExperimentsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListExperimentsResponse {
        try await self.client.execute(
            operation: "ListExperiments", 
            path: "/experiments", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your experiments.
    ///
    /// Parameters:
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listExperiments(
        experimentTemplateId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListExperimentsResponse {
        let input = ListExperimentsRequest(
            experimentTemplateId: experimentTemplateId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listExperiments(input, logger: logger)
    }

    /// Lists the tags for the specified resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags for the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists the target account configurations of the specified experiment template.
    @Sendable
    @inlinable
    public func listTargetAccountConfigurations(_ input: ListTargetAccountConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTargetAccountConfigurationsResponse {
        try await self.client.execute(
            operation: "ListTargetAccountConfigurations", 
            path: "/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the target account configurations of the specified experiment template.
    ///
    /// Parameters:
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results,  make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTargetAccountConfigurations(
        experimentTemplateId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTargetAccountConfigurationsResponse {
        let input = ListTargetAccountConfigurationsRequest(
            experimentTemplateId: experimentTemplateId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listTargetAccountConfigurations(input, logger: logger)
    }

    /// Lists the target resource types.
    @Sendable
    @inlinable
    public func listTargetResourceTypes(_ input: ListTargetResourceTypesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTargetResourceTypesResponse {
        try await self.client.execute(
            operation: "ListTargetResourceTypes", 
            path: "/targetResourceTypes", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the target resource types.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token for the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTargetResourceTypes(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTargetResourceTypesResponse {
        let input = ListTargetResourceTypesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listTargetResourceTypes(input, logger: logger)
    }

    /// Starts running an experiment from the specified experiment template.
    @Sendable
    @inlinable
    public func startExperiment(_ input: StartExperimentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartExperimentResponse {
        try await self.client.execute(
            operation: "StartExperiment", 
            path: "/experiments", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts running an experiment from the specified experiment template.
    ///
    /// Parameters:
    ///   - clientToken: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - experimentOptions: The experiment options for running the experiment.
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - tags: The tags to apply to the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func startExperiment(
        clientToken: String = StartExperimentRequest.idempotencyToken(),
        experimentOptions: StartExperimentExperimentOptionsInput? = nil,
        experimentTemplateId: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartExperimentResponse {
        let input = StartExperimentRequest(
            clientToken: clientToken, 
            experimentOptions: experimentOptions, 
            experimentTemplateId: experimentTemplateId, 
            tags: tags
        )
        return try await self.startExperiment(input, logger: logger)
    }

    /// Stops the specified experiment.
    @Sendable
    @inlinable
    public func stopExperiment(_ input: StopExperimentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopExperimentResponse {
        try await self.client.execute(
            operation: "StopExperiment", 
            path: "/experiments/{id}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops the specified experiment.
    ///
    /// Parameters:
    ///   - id: The ID of the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopExperiment(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopExperimentResponse {
        let input = StopExperimentRequest(
            id: id
        )
        return try await self.stopExperiment(input, logger: logger)
    }

    /// Applies the specified tags to the specified resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Applies the specified tags to the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tags: The tags for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes the specified tags from the specified resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes the specified tags from the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tagKeys: The tag keys to remove.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates the specified experiment template.
    @Sendable
    @inlinable
    public func updateExperimentTemplate(_ input: UpdateExperimentTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateExperimentTemplateResponse {
        try await self.client.execute(
            operation: "UpdateExperimentTemplate", 
            path: "/experimentTemplates/{id}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the specified experiment template.
    ///
    /// Parameters:
    ///   - actions: The actions for the experiment.
    ///   - description: A description for the template.
    ///   - experimentOptions: The experiment options for the experiment template.
    ///   - experimentReportConfiguration: The experiment report configuration for the experiment template.
    ///   - id: The ID of the experiment template.
    ///   - logConfiguration: The configuration for experiment logging.
    ///   - roleArn: The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.
    ///   - stopConditions: The stop conditions for the experiment.
    ///   - targets: The targets for the experiment.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateExperimentTemplate(
        actions: [String: UpdateExperimentTemplateActionInputItem]? = nil,
        description: String? = nil,
        experimentOptions: UpdateExperimentTemplateExperimentOptionsInput? = nil,
        experimentReportConfiguration: UpdateExperimentTemplateReportConfigurationInput? = nil,
        id: String,
        logConfiguration: UpdateExperimentTemplateLogConfigurationInput? = nil,
        roleArn: String? = nil,
        stopConditions: [UpdateExperimentTemplateStopConditionInput]? = nil,
        targets: [String: UpdateExperimentTemplateTargetInput]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateExperimentTemplateResponse {
        let input = UpdateExperimentTemplateRequest(
            actions: actions, 
            description: description, 
            experimentOptions: experimentOptions, 
            experimentReportConfiguration: experimentReportConfiguration, 
            id: id, 
            logConfiguration: logConfiguration, 
            roleArn: roleArn, 
            stopConditions: stopConditions, 
            targets: targets
        )
        return try await self.updateExperimentTemplate(input, logger: logger)
    }

    ///  Updates the specified safety lever state.
    @Sendable
    @inlinable
    public func updateSafetyLeverState(_ input: UpdateSafetyLeverStateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateSafetyLeverStateResponse {
        try await self.client.execute(
            operation: "UpdateSafetyLeverState", 
            path: "/safetyLevers/{id}/state", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Updates the specified safety lever state.
    ///
    /// Parameters:
    ///   - id:  The ID of the safety lever.
    ///   - state:  The state of the safety lever.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateSafetyLeverState(
        id: String,
        state: UpdateSafetyLeverStateInput,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateSafetyLeverStateResponse {
        let input = UpdateSafetyLeverStateRequest(
            id: id, 
            state: state
        )
        return try await self.updateSafetyLeverState(input, logger: logger)
    }

    /// Updates the target account configuration for the specified experiment template.
    @Sendable
    @inlinable
    public func updateTargetAccountConfiguration(_ input: UpdateTargetAccountConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateTargetAccountConfigurationResponse {
        try await self.client.execute(
            operation: "UpdateTargetAccountConfiguration", 
            path: "/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the target account configuration for the specified experiment template.
    ///
    /// Parameters:
    ///   - accountId: The Amazon Web Services account ID of the target account.
    ///   - description: The description of the target account.
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - roleArn: The Amazon Resource Name (ARN) of an IAM role for the target account.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTargetAccountConfiguration(
        accountId: String,
        description: String? = nil,
        experimentTemplateId: String,
        roleArn: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateTargetAccountConfigurationResponse {
        let input = UpdateTargetAccountConfigurationRequest(
            accountId: accountId, 
            description: description, 
            experimentTemplateId: experimentTemplateId, 
            roleArn: roleArn
        )
        return try await self.updateTargetAccountConfiguration(input, logger: logger)
    }
}

extension FIS {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: FIS, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension FIS {
    /// Return PaginatorSequence for operation ``listActions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listActionsPaginator(
        _ input: ListActionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListActionsRequest, ListActionsResponse> {
        return .init(
            input: input,
            command: self.listActions,
            inputKey: \ListActionsRequest.nextToken,
            outputKey: \ListActionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listActions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listActionsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListActionsRequest, ListActionsResponse> {
        let input = ListActionsRequest(
            maxResults: maxResults
        )
        return self.listActionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listExperimentResolvedTargets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentResolvedTargetsPaginator(
        _ input: ListExperimentResolvedTargetsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListExperimentResolvedTargetsRequest, ListExperimentResolvedTargetsResponse> {
        return .init(
            input: input,
            command: self.listExperimentResolvedTargets,
            inputKey: \ListExperimentResolvedTargetsRequest.nextToken,
            outputKey: \ListExperimentResolvedTargetsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listExperimentResolvedTargets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - experimentId: The ID of the experiment.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results,  make another call with the returned nextToken value.
    ///   - targetName: The name of the target.
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentResolvedTargetsPaginator(
        experimentId: String,
        maxResults: Int? = nil,
        targetName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListExperimentResolvedTargetsRequest, ListExperimentResolvedTargetsResponse> {
        let input = ListExperimentResolvedTargetsRequest(
            experimentId: experimentId, 
            maxResults: maxResults, 
            targetName: targetName
        )
        return self.listExperimentResolvedTargetsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listExperimentTemplates(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentTemplatesPaginator(
        _ input: ListExperimentTemplatesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListExperimentTemplatesRequest, ListExperimentTemplatesResponse> {
        return .init(
            input: input,
            command: self.listExperimentTemplates,
            inputKey: \ListExperimentTemplatesRequest.nextToken,
            outputKey: \ListExperimentTemplatesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listExperimentTemplates(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentTemplatesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListExperimentTemplatesRequest, ListExperimentTemplatesResponse> {
        let input = ListExperimentTemplatesRequest(
            maxResults: maxResults
        )
        return self.listExperimentTemplatesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listExperiments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentsPaginator(
        _ input: ListExperimentsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListExperimentsRequest, ListExperimentsResponse> {
        return .init(
            input: input,
            command: self.listExperiments,
            inputKey: \ListExperimentsRequest.nextToken,
            outputKey: \ListExperimentsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listExperiments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listExperimentsPaginator(
        experimentTemplateId: String? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListExperimentsRequest, ListExperimentsResponse> {
        let input = ListExperimentsRequest(
            experimentTemplateId: experimentTemplateId, 
            maxResults: maxResults
        )
        return self.listExperimentsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTargetAccountConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTargetAccountConfigurationsPaginator(
        _ input: ListTargetAccountConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTargetAccountConfigurationsRequest, ListTargetAccountConfigurationsResponse> {
        return .init(
            input: input,
            command: self.listTargetAccountConfigurations,
            inputKey: \ListTargetAccountConfigurationsRequest.nextToken,
            outputKey: \ListTargetAccountConfigurationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTargetAccountConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - experimentTemplateId: The ID of the experiment template.
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results,  make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTargetAccountConfigurationsPaginator(
        experimentTemplateId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTargetAccountConfigurationsRequest, ListTargetAccountConfigurationsResponse> {
        let input = ListTargetAccountConfigurationsRequest(
            experimentTemplateId: experimentTemplateId, 
            maxResults: maxResults
        )
        return self.listTargetAccountConfigurationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTargetResourceTypes(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTargetResourceTypesPaginator(
        _ input: ListTargetResourceTypesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTargetResourceTypesRequest, ListTargetResourceTypesResponse> {
        return .init(
            input: input,
            command: self.listTargetResourceTypes,
            inputKey: \ListTargetResourceTypesRequest.nextToken,
            outputKey: \ListTargetResourceTypesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTargetResourceTypes(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTargetResourceTypesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTargetResourceTypesRequest, ListTargetResourceTypesResponse> {
        let input = ListTargetResourceTypesRequest(
            maxResults: maxResults
        )
        return self.listTargetResourceTypesPaginator(input, logger: logger)
    }
}

extension FIS.ListActionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListActionsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension FIS.ListExperimentResolvedTargetsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListExperimentResolvedTargetsRequest {
        return .init(
            experimentId: self.experimentId,
            maxResults: self.maxResults,
            nextToken: token,
            targetName: self.targetName
        )
    }
}

extension FIS.ListExperimentTemplatesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListExperimentTemplatesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension FIS.ListExperimentsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListExperimentsRequest {
        return .init(
            experimentTemplateId: self.experimentTemplateId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension FIS.ListTargetAccountConfigurationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListTargetAccountConfigurationsRequest {
        return .init(
            experimentTemplateId: self.experimentTemplateId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension FIS.ListTargetResourceTypesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> FIS.ListTargetResourceTypesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
